package com.admin.dao.bookdao;


import com.admin.dto.BookListBean;
import com.admin.dto.BookLossBean;
import com.admin.dto.QueryReturnListBean;
import com.pojo.BooksBean;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

public interface BookDaoInF {

    public boolean InsertInfo(String sql, Connection conn, BooksBean booksBean) throws SQLException;

    public List<BookListBean> getbookList(String sql, Connection conn, int pageIndex, int pageSize) throws SQLException;

    public int getBookSum(String sql, Connection conn) throws SQLException;

    /**
     * 传入id书籍下架
     *
     * @param sql
     * @param conn
     * @param bookid
     * @return
     */
    public boolean delBookInfoById(String sql, Connection conn, int bookid) throws SQLException;

    /**
     * 书籍的修改
     *
     * @param sql
     * @param conn
     * @param booksBean
     * @return
     * @throws SQLException
     */

    public boolean alterBookInfoById(String sql, Connection conn, BooksBean booksBean) throws SQLException;

    List<QueryReturnListBean> getAllBookInfo(String sql, Connection conn, String bookName) throws SQLException;

    /**
     * 直接查询所有书籍信息
     *
     * @param sql
     * @param conn
     * @return
     * @throws SQLException
     */
    List<BookListBean> queryAllBookInfo(String sql, Connection conn) throws SQLException;

    /**
     * 查看书籍损毁
     *
     * @param sql
     * @param conn
     * @return
     * @throws SQLException
     */

    List<BookLossBean> queryBookDemageInfo(String sql, Connection conn) throws SQLException;

    /**
     * 通过书id查询书籍信息
     *
     * @param sql
     * @param conn
     * @param bookId
     * @return
     */
    BooksBean queryBookById(String sql, Connection conn, String bookId) throws SQLException;

    BooksBean queryBookByNameDao(String sql, Connection conn, String bookname) throws SQLException;


    boolean updateStock(String sql, Connection conn, String bookId) throws SQLException;

    /**
     * 书籍损毁情况
     */
    String demageDegreeDao(String sql, Connection conn, Integer id) throws SQLException;
}

